using UnityEditor;
using UnityEngine;

[CustomPropertyDrawer(typeof(RenameFieldAttribute))]
public class RenameFieldAttribute_Drawer : PropertyDrawer
{
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        RenameFieldAttribute att = (RenameFieldAttribute)attribute;
        label.text = att.header;
        EditorGUI.BeginDisabledGroup(!att.isDisplay);
        EditorGUI.PropertyField(position, property, label, true);
        EditorGUI.EndDisabledGroup();
    }
}